
<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <!--<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />-->
    <meta name="renderer" content="webkit"/>
    <title></title>
    <link rel="stylesheet" href="__CSS__/pintuer.css"/>
    <link rel="stylesheet" href="__CSS__/admin.css"/>
    <link rel="stylesheet" href="__CSS__/jquery.datetimepicker.css"/>
    <script src="__JS__/jquery-1.8.3.min.js"></script>
    <script src="__JS__/jquery.js"></script>
    <script src="__JS__/pintuer.js"></script>
    <link href="__JS__/bootstrap-3.3.4.css" rel="stylesheet"/>
    <!--<script type="text/javascript" src="__JS__/merchant_submit/merchant_submit.js" charset="utf-8"></script>-->

    <script src="__JS__/layer/layer.js"></script>

</head>
<body>
<div class="panel admin-panel">
    <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>修改路线</strong></div>
    <div class="body-content">
        {volist name='list' id='list'}
        <form method="post" class="form-x" action="{:url('Tourism/route_update_app')}?id={$list.id}" enctype="multipart/form-data" id="form">
            <div class="form-group">
                <div class="label">
                    <label>路线名称：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="{$list.name}" name="name" id="restaurant_name" data-validate="required:请输入内容" />
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>图片：</label>
                </div>
                <div>
                    <img src="__UPLOADS__/{$list.img}"width="100px">
                    <span id="preview"></span>
                </div>

                <div class="field" style="position: relative;left: 100px">
                    <div class="field" style="position: relative;margin-left: 150px">
                        <input value="{$list.img}" onchange="preview(this)" id="img" type="file" name="img"/>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>类型：</label>
                </div>
                <select name="class" id="merchant_if" class="">
                    <option value="0" class="input">国内</option>
                    <option value="1" class="input">国外</option>
                </select>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>介绍：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w100" name="introduce" id="introduce" value="{$list.introduce}"  />
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>价格：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="{$list.amounts}" name="amounts" id="amounts" data-validate="required:请输入价格" />
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>导游ID：</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" value="{$list.guide_id}" name="guide_id" id="guide_id" data-validate="required:请输入导游ID" />
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>开始时间：</label>
                </div>
                <div class="field">
                    <input type="text" value="{$list.start_time}" name="start_time" class="input w50" id="datetimepicker_mask"/>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>结束时间：</label>
                </div>
                <div class="field">
                    <input type="text" value="{$list.end_time}" name="end_time" class="input w50" id="imepicker_mask"/>
                    <div class="tips"></div>
                </div>
            </div>
            <div class="field" style="margin-left: 150px">
                <input type="submit" class="button bg-main icon-check-square-o" id="admin_add_tj" value="提交">
            </div>
        </form>
{/volist}
    </div>
</div>

<script src="__JS__/distpicker.data.js"></script>
<script src="__JS__/distpicker.js"></script>
<script src="__JS__/main.js"></script>
<script src="__JS__/jquery.js"></script>
<script src="__JS__/jquery.datetimepicker.js"></script>
</body></html>
<script>

    $('#datetimepicker_mask').datetimepicker({
//        mask:'9999/19/39 29:59'
    });
    $('#imepicker_mask').datetimepicker({
//        mask:'9999/19/39 29:59'
    });
    var url = "{:url('Index/index')}"

    function preview(file)
    {
        var prevDiv = document.getElementById('preview');
        if (file.files && file.files[0])
        {
            var reader = new FileReader();
            reader.onload = function(evt){
                prevDiv.innerHTML = '<img src="' + evt.target.result + '"  width="100px"/>';
            }
            reader.readAsDataURL(file.files[0]);
        }
        else
        {
            prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
        }
    }
</script>